﻿using System.Data;

namespace ConfExpert.Forms.Rapor.Aker
{
    public partial class xrAkerRapor : DevExpress.XtraReports.UI.XtraReport
    {
        public xrAkerRapor(DataSet ds1)
        {

            InitializeComponent();
            //cellTarih.Text = DateTime.Now.ToShortDateString();
            ds = ds1;

            tcCustomer.Text = ds.Tables[0].Rows[0]["CustomerName"].ToString();
            tcAdres.Text = ds.Tables[0].Rows[0]["Address"].ToString();
            tcPhone.Text = ds.Tables[0].Rows[0]["Phone"].ToString();
            tcFair.Text = ds.Tables[0].Rows[0]["Fair"].ToString();
            tcReference.Text = ds.Tables[0].Rows[0]["Reference"].ToString();
            tcNot.Text = ds.Tables[0].Rows[0]["Notes"].ToString();
            tcSeason.Text = ds.Tables[0].Rows[0]["Season"].ToString();
            tcMail.Text = ds.Tables[0].Rows[0]["Email"].ToString();
            tcDate.Text = ds.Tables[0].Rows[0]["ModifiedOn"].ToString();

            //sumEur.DataBindings.Add("Text", null, "Table2.sumEUR", "{0:n}");
            //sumMt.DataBindings.Add("Text", null, "Table2.sumMt", "{0:n}");
            //sumTotal.DataBindings.Add("Text", null, "Table2.sumTotal", "{0:n}");
        }

        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            this.DataMember = "Table1";
            this.DataSource = ds;
            detailProductId.DataBindings.Add("Text", null, "Table1.ProductId");
            detailArticle.DataBindings.Add("Text", null, "Table1.Article");
            detailWeight.DataBindings.Add("Text", null, "Table1.Weight");
            detailWidth.DataBindings.Add("Text", null, "Table1.Width");
            detailComposition.DataBindings.Add("Text", null, "Table1.Composition");
            detailDesign.DataBindings.Add("Text", null, "Table1.Design");
            detailEur.DataBindings.Add("Text", null, "Table1.EUR", "{0:n}");
            detailMt.DataBindings.Add("Text", null, "Table1.Mt", "{0:n}");
            //detailLineTotal.DataBindings.Add("Text", null, "Table1.LineTotal", "{0:n}");                        
        }
    }
}
